
// import { useParams } from "react-router-dom";

// function Info(){
//     const p = useParams();
// console.log(p);
//     return <div> 商品详情</div>
// }
// export default Info;

import React, { Component } from 'react'
import {useParams,useLocation,useNavigate}  from "react-router-dom"
function withRouter(Component) {
    return (props) => (
      <Component
        {...props}
        params={useParams()}
        location={useLocation()}
        navigate={useNavigate()}
      />
    );
  }
class Info extends Component{
    render(){
        console.log(this.props.params);
        return <div>Info</div>
    }
}
export default withRouter(Info);